home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr47 / wasm223.zip / SEND < prev    next >
Text File  |  1993-05-04  |  1KB  |  44 lines

  1. //
  2. // SESSION Send Routines, By Eric Tauck
  3. //
  4. // Requires:
  5. //
  6. //   STRING
  7. //   TIMER
  8. //
  9.  
  10. Send_End JUMP
  11.  
  12. : Hide { 0 }                    // SendByte hidden flag
  13. : Speed { 0 }                   // SendByte pause ticks
  14.  
  15. // ------------
  16. // Send a byte.
  17. // ------------
  18.  
  19. : SendByte                      // (byte - )
  20.   Hide @ SendByte1 ?JUMP        // check if hidden
  21.     Speed @ Pause CALL TERM ;   // send byte via the terminal
  22.   : SendByte1
  23.   Speed @ Pause CALL CPUT ;     // send byte directly (hidden)
  24.  
  25. // --------------
  26. // Send a string.
  27. // --------------
  28.  
  29. : SendString                    // (string - )
  30.   SendByte ForString CALL ;     // send each byte of the string
  31.  
  32. // ------------------------------
  33. // Send an initialization string.
  34. // ------------------------------
  35.  
  36. : SendInitString                // (string - )
  37.   Hide @ Speed @                // save hide flag and speed
  38.   TRUE Hide ! 5 Speed !         // set hide to true and slow to 4 ticks
  39.   ROT SendString CALL           // send string
  40.   13 SendByte CALL              // send ENTER
  41.   Speed ! Hide ! ;              // restore hide flag and speed
  42.  
  43. : Send_End
  44.